package cn.skyclass.events
{
	import cn.skyclass.beans.UserBean;
	import cn.skyclass.net.UserToken;
	
	import flash.events.Event;
	
	/**
	 * 用户身份或状态相关的事件
	 */
	public class UserEvent extends Event
	{
		public static const LOGINING:String = "logining";
		public static const LOGIN_FAILED:String = "loginFailed";
		public static const LOGIN_SUCCESS:String = "loginSuccess";
		public static const LOGOUT:String = "logout";
						
		public var msg:String;
		public var token:UserToken;
		public var user:UserBean;
		
		public function UserEvent(type:String, msg:String="", user:UserBean=null, token:UserToken=null){
			super(type);
			this.msg = msg;
			this.user = user;
			this.token = token;
		}
		
		override public function clone():Event{
			return new UserEvent(this.type, this.msg, this.user, this.token);
		}			
	}
}